package org.halo.trade.data.sina;


public class Level2_50orderInfo
{
	public String symbol;// 证券代码

	public double buy_price;// 委托买一，价格6.66
	public long buy_count;// 该价位上，总共，手
	public int buy_bi;// 该价位上，总笔
	public long[] buyvol;

	public double sell_price;// 委托卖一，价格
	public long sell_count;
	public int sell_bi;
	public long[] sellvol;

	// public void print()
	// {
	// System.out.println("卖 一：" + sell_price + ",共" + sell_count + "手,共" +
	// sell_bi + "笔：");
	// for (int i = 0; i < sellvol.length; i++)
	// {
	// System.out.print(sellvol[i] + "\t");
	// }
	// System.out.println("-----------------------------------------------");
	// System.out.println("买 一：" + buy_price + ",共" + buy_count + "手,共" + buy_bi
	// + "笔：");
	// for (int i = 0; i < buyvol.length; i++)
	// {
	// System.out.print(buyvol[i] + "\t");
	// }
	// System.out.println();
	// }

	public void print()
	{
		System.out.print(getStr());
	}

	final private int word_width = 8;
	final private int line_width = 20;

	public String getStr()
	{

		String str = "";
		str = "卖 一：" + sell_price + ",共" + sell_count/100 + "手,共" + sell_bi + "笔：\n";
		if (sellvol != null)
		{
			String tmp = "";
			for (int i = 0; i < sellvol.length; i++)
			{
				tmp += Utils.pad(sellvol[i] / 100 + "", word_width);
				if ((i + 1) % line_width == 0)
				{
					tmp += "\n";
				}
			}
			str += tmp + "\n";
		}
		str += "买 一：" + buy_price + ",共" + buy_count/100 + "手,共" + buy_bi + "笔：\n";
		if (buyvol != null)
		{
			String tmp = "";
			for (int i = 0; i < buyvol.length; i++)
			{
				tmp += Utils.pad(buyvol[i] / 100 + "", word_width);
				if ((i + 1) % line_width == 0)
				{
					tmp += "\n";
				}
			}
			 str += tmp ;
		}

		return str;
	}

}
